﻿@using Company.Project.Domain.Model
@model Project_SYS_Module
@Html.HiddenFor(x=>x.ID)
@Html.HiddenFor(x => x.ModuleUrl)

<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"> <span style="color: red">*</span>模块名称 </label>
    <div class="col-sm-9">
        <div class="clearfix">
            <input type="text" id="ModuleName" name="ModuleName" required value="@Model.ModuleName" placeholder="请输入模块名称" class="col-xs-10 col-sm-5">
        </div>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"> 父级模块 </label>
    <div class="col-sm-9">
        <div class="clearfix">
            <select class="input-medium" id="PID" name="PID" ajax-url="/Admin/System/GetFatherModule?fatherId=@Model.PID&itemId=@Model.ID"></select>
        </div>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"><span style="color: red">*</span> 排序编号 </label>
    <div class="col-sm-9">
        <div class="clearfix">
            <input type="text" id="OrderID" name="OrderID" required digits="true" value="@Model.OrderID" placeholder="请输入排序编号" class="col-xs-10 col-sm-5">
        </div>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"> 模块样式 </label>
    <div class="col-sm-9">
        <div class="clearfix">
            <input type="text" id="ModuleCls" name="ModuleCls" value="@Model.ModuleCls" placeholder="请输入模块样式" class="col-xs-10 col-sm-5">
        </div>
    </div>
</div>
<div class="form-group">
    <label class="col-sm-3 control-label no-padding-right"> 模块功能 </label>
    <div class="col-sm-9">
        <div class="fieldset">
            <a class="btn btn-xs" id="addChild"><i class="ace-icon fa fa-plus-circle"></i>新增</a>
            <a class="btn btn-xs" id="addChildDef"><i class="ace-icon fa fa-plus-circle"></i>新增默认(增、删、改、查、导)</a>
            <input class="input-small" style="margin-left: 20px;" id="defConroller" placeholder="默认控制器名"/><input id="defMainAction" style="margin-left: 20px;" class="input-small" placeholder="默认主方法名"/>
        </div>
    </div>
</div>
<div class="form-group actionList">

</div>
<script src="~/Areas/Admin/js/System/ModuleDetial.js"></script>
<script type="text/javascript">
    $(function () {
        setTimeout(function() {
        @{
            if (Model.ModuleActions != null)
            {
                foreach (var action in Model.ModuleActions.OrderBy(x => x.OrderID).Where(x => !x.IsDeleted))
                {
                    @:parent.addItem({ ID: "@action.ID", ActionName: "@action.ActionName", ActionUrl: "@action.ActionUrl", OrderID: "@action.OrderID", ShowEnum: "@action.ShowEnum.ToString()", ActionCls: "@action.ActionCls", ActionFun: "@action.ActionFun" });
                }
            }
        }
        }, 100);
    });
</script>